/**
 * @param {number} n
 * @return {boolean}
 */
var isFascinating = function (n) {
  let d = 2 * n, t = 3 * n
  let str = '' + n + d + t
  let set = new Set()
  for (let i = 0; i < str.length; i++) {
    if (str[i] == 0 || set.has(str[i])) return false
    else set.add(str[i])
  }
  return set.size == 9
};